home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / util / dtype / RGBx_DT.lha / RGBx_DT / RGBN-RGB8.doc < prev    next >
Text File  |  1998-03-17  |  3KB  |  86 lines

  1. RGB image forms, Turbo Silver (Impulse)
  2.  
  3.                     FORM RGBN and FORM RGB8
  4.                     -----------------------
  5.  
  6.     RGBN and RGB8 files are used in Impulse's Turbo Silver and Imagine.
  7.     They are almost identical to FORM ILBM's except for the BODY chunk
  8.     and slight differences in the BMHD chunk.
  9.  
  10.     A CAMG chunk IS REQUIRED.
  11.  
  12.     The BMHD chunk specfies the number of bitplanes as 13 for type RGBN
  13.     and the 25 for type RGB8, and compression type as 4.
  14.  
  15.     The FORM RGBN uses 12 bit RGB values, and the FORM RGB8 uses
  16.     24 bit RGB values.
  17.  
  18.     The BODY chunk contains RGB values, a "genlock" bit, and repeat
  19.     counts.  In Silver, when "genlock" bit is set, a "zero color" is
  20.     written into the bitplanes for genlock video to show through.
  21.     In Diamond and Light24 (Impulse's 12 & 24 bit paint programs),
  22.     the genlock bit is ignored if the file is loaded as a picture
  23.     (and the RGB color is used instead), and if the file is loaded
  24.     as a brush the genlock bit marks pixels that are not part of
  25.     the brush.
  26.  
  27.     For both RGBN and RGB8 body chunks, each RGB value always has a
  28.     repeat count.  The values are written in different formats depending
  29.     on the magnitude of the repeat count.
  30.  
  31.     For the RGBN BODY chunk:
  32.  
  33.         For each RGB value, a WORD (16-bits) is written: with the
  34.         12 RGB bits in the MSB (most significant bit) positions;
  35.         the "genlock" bit next; and then a 3 bit repeat count.  
  36.         If the repeat count is greater than 7, the 3-bit count is
  37.         zero, and a BYTE repeat count follows.  If the repeat count
  38.         is greater than 255, the BYTE count is zero, and a WORD
  39.         repeat count follows.  Repeat counts greater than 65536 are
  40.         not supported.
  41.  
  42.     For the RGB8 body chunk:
  43.  
  44.         For each RGB value, a LONG-word (32 bits) is written:
  45.         with the 24 RGB bits in the MSB positions; the "genlock"
  46.         bit next, and then a 7 bit repeat count.
  47.  
  48.         In a previous version of this document, there appeared the
  49.         following line:
  50.  
  51.         "If the repeat count is greater than 127, the same rules apply
  52.         as in the RGBN BODY."
  53.  
  54.         But Impulse has never written more than a 7 bit repeat count,
  55.         and when Imagine and Light24 were written, they didn't support
  56.         reading anything but 7 bit counts.
  57.  
  58.     Sample BODY code:
  59.  
  60.             if(!count) {
  61.                 if (Rgb8) {
  62.                     fread (&w, 4, 1, RGBFile);
  63.                     lock = w & 0x00000080;
  64.                     rgb = w >> 8;
  65.                     count = w & 0x0000007f;
  66.                 } else {
  67.                     w = (UWORD) getw (RGBFile);
  68.                     lock = w & 8;
  69.                     rgb = w >> 4;
  70.                     count = w & 7;
  71.                 }
  72.                 if (!count)
  73.                     if (!(count = (UBYTE) getc (RGBFile)))
  74.                         count = (UWORD) getw (RGBFile);
  75.             }
  76.  
  77.     The pixels are scanned from left to right across horizontal
  78.     lines, processing from top to bottom.  The (12 or 24 bit) RGB
  79.     values are stored with the red bits as the MSB's, the green
  80.     bits next, and the blue bits as the LSB's.
  81.  
  82.     Special note:  As of this writing (Sep 88), Silver does NOT
  83.     support anything but black for color zero.
  84.  
  85.  
  86.